Call gtk_selection_remove_all() here, not in destroy/ finalize. (#66636,
authorOwen Taylor <otaylor@redhat.com>
Thu, 17 Jan 2002 22:28:02 +0000 (22:28 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 17 Jan 2002 22:28:02 +0000 (22:28 +0000)
Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
gtk_selection_remove_all() here, not in destroy/
finalize. (#66636, Sergey Vlasov)

* gtk/gtkselection.c (gtk_selection_request): Fix
reentrancy problem with multiple conversions.

* gtk/gtkselection.c (gtk_selection_remove_all):
Don't remove incrs, we don't need the widget for
maintain the incr.

* gtk/gtkselection.c (struct _GtkIncrInfo): Remove
the widget field from here, we don't need it.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkselection.c
gtk/gtkwidget.c

index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index e083ff9ddda3f9111522522da6a8081e5ded1f7b..1e10abcd7ca864f22b68ea7aae1f6807bb5c7505 100644 (file)
@@ -1,3 +1,19 @@
+Thu Jan 17 17:02:38 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwidget.c (gtk_widget_real_unrealize): Call
+       gtk_selection_remove_all() here, not in destroy/
+       finalize. (#66636, Sergey Vlasov)
+
+       * gtk/gtkselection.c (gtk_selection_request): Fix
+       reentrancy problem with multiple conversions.
+
+       * gtk/gtkselection.c (gtk_selection_remove_all): 
+       Don't remove incrs, we don't need the widget for
+       maintain the incr.
+
+       * gtk/gtkselection.c (struct _GtkIncrInfo): Remove
+       the widget field from here, we don't need it.
+
 Thu Jan 17 13:08:34 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gdk/x11/gdkmain-x11.c (gdk_error_trap_push): Move
index d7638787ec357a9d91e4f9786d7818734f671a39..d973e73741f24f036caf7aabd3ae028c5579e6bb 100644 (file)
@@ -102,7 +102,6 @@ struct _GtkIncrConversion
 
 struct _GtkIncrInfo
 {
-  GtkWidget *widget;           /* Selection owner */
   GdkWindow *requestor;                /* Requestor window - we create a GdkWindow
                                   so we can receive events */
   GdkAtom    selection;                /* Selection we're sending */
@@ -547,19 +546,6 @@ gtk_selection_remove_all (GtkWidget *widget)
   
   /* Remove pending requests/incrs for this widget */
   
-  tmp_list = current_incrs;
-  while (tmp_list)
-    {
-      next = tmp_list->next;
-      if (((GtkIncrInfo *)tmp_list->data)->widget == widget)
-       {
-         current_incrs = g_list_remove_link (current_incrs, tmp_list);
-         /* structure will be freed in timeout */
-         g_list_free (tmp_list);
-       }
-      tmp_list = next;
-    }
-  
   tmp_list = current_retrievals;
   while (tmp_list)
     {
@@ -1056,8 +1042,9 @@ gtk_selection_request (GtkWidget *widget,
     return FALSE;
   
   info = g_new (GtkIncrInfo, 1);
+
+  g_object_ref (widget);
   
-  info->widget = widget;
   info->selection = event->selection;
   info->num_incrs = 0;
   
@@ -1211,12 +1198,14 @@ gtk_selection_request (GtkWidget *widget,
       gdk_selection_send_notify (event->requestor, event->selection, 
                                 event->target, event->property, event->time);
     }
-  
+
   if (info->num_incrs == 0)
     {
       g_free (info->conversions);
       g_free (info);
     }
+
+  g_object_unref (widget);
   
   return TRUE;
 }
index 5a448e9ec3cad6d4ee166e676c347bfce3fd7fe3..e2238db7be98887926e26d90197d5118095a2a0f 100644 (file)
@@ -5570,7 +5570,6 @@ gtk_widget_real_destroy (GtkObject *object)
   g_object_set_qdata (G_OBJECT (widget), quark_accel_closures, NULL);
 
   gtk_grab_remove (widget);
-  gtk_selection_remove_all (widget);
   
   g_object_unref (widget->style);
   widget->style = gtk_widget_get_default_style ();
@@ -5589,7 +5588,6 @@ gtk_widget_finalize (GObject *object)
   GtkAccessible *accessible;
   
   gtk_grab_remove (widget);
-  gtk_selection_remove_all (widget);
 
   g_object_unref (widget->style);
   widget->style = NULL;
@@ -5729,6 +5727,8 @@ gtk_widget_real_unrealize (GtkWidget *widget)
       widget->window = NULL;
     }
 
+  gtk_selection_remove_all (widget);
+  
   GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
 }